var e = getApp();

Page({
    data: {
        agent: null,
        relatedLink: [ {
            name: "plaen_order",
            title: "订货",
            url: "/packageH/stock/guide/guide",
            icon: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/stock/plean_order.png"
        }, {
            name: "my_inventory",
            title: "我的库存",
            url: "/packageH/stock/my/my",
            icon: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/stock/my_inventory.png"
        }, {
            name: "my_order",
            title: "零售",
            url: "/packageH/stock/guide/guide?target=retail",
            icon: "https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/images/stock/my_order.png"
        } ]
    },
    onLoad: function() {
        this.getAgent(), wx.setNavigationBarTitle({
            title: "云库存"
        });
    },
    onShareAppMessage: function() {},
    onShareTimeline: function() {},
    getAgent: function() {
        var t = this;
        wx.showLoading({
            title: "加载中",
            mask: !0
        });
        var a = e.getNetAddresss("plugin.agency.api.agency.index");
        e._postNetWork({
            url: a,
            success: function(e) {
                var a = e.data, i = a.data, n = a.result, o = a.msg;
                if (0 === n) return wx.hideLoading(), void wx.showToast({
                    title: o,
                    success: function() {
                        wx.redirectTo({
                            url: "/packageG/member_v2/member_v2"
                        });
                    }
                });
                t.setData({
                    agent: i
                }), wx.hideLoading();
            }
        });
    }
});